﻿using personalplaner.common;
using personalplaner.common.mvvm.common;
using personalplaner.common.mvvm.factory;
using personalplaner.servicemodel.dataaccess;

namespace personalplaner.viewmodels.factories
{
    public class MainMenuFactory : IFactory
	{
		#region IFactory Members
		
		public object CreateViewModel(System.Windows.DependencyObject sender)
        {
            if (Designer.IsDesignMode)
                return null;

			var vm = new MainMenuViewModel(sender);

			vm.ServiceLocator.RegisterService<ICommonDataAccess>(new CommonDataAccess(SettingsProvider.Settings));

			return vm;
		}

		#endregion
	}
}
